package com.axxc.jpa.annotation;

import java.util.regex.Pattern;

public final class RegularExpressionUtil {

	private RegularExpressionUtil() {
		throw new IllegalAccessError("非法构造");
	}

	public static final String EMAIL = "([a-zA-Z0-9_\\-\\.]+)@(([a-zA-Z0-9\\-]+\\.)+)([a-zA-Z]{2,10}|[0-9]{1,3})$";
	public static final String MOBILE = "[1][0-9]{10}";
	private static final Pattern PATTERN_EMAIL = Pattern.compile(EMAIL);
	private static final Pattern PATTERN_MOBILE = Pattern.compile(MOBILE);

	public static boolean matchEmail(String characters) {
		return PATTERN_EMAIL.matcher(characters).matches();
	}

	public static boolean matchMobilePhone(String characters) {
		return PATTERN_MOBILE.matcher(characters).matches();
	}
}